﻿<div class="top-row pl-4 navbar navbar-dark">
    <a class="navbar-brand" href="">BlazorWorker Demo</a>
    <button class="navbar-toggler" @onclick="ToggleNavMenu">
        <span class="navbar-toggler-icon"></span>
    </button>
</div>

<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
    <ul class="nav flex-column">
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="" Match="NavLinkMatch.All">
                <span class="oi oi-cog" aria-hidden="true"></span> Simple Worker
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="BackgroundServiceMulti">
                <span class="oi oi-copywriting" aria-hidden="true"></span> Multiple Workers
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="CoreExample">
                <span class="oi oi-command" aria-hidden="true"></span> Core Example
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="Http">
                <span class="oi oi-globe" aria-hidden="true"></span> HttpClient Example
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="IoCExample">
                <span class="oi oi-globe" aria-hidden="true"></span> IoC / DI Example
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="https://github.com/tewr/BlazorWorker">
                <span class="oi oi-fork" aria-hidden="true"></span> To the source!
            </NavLink>
        </li>


        <li class="nav-item px-3">
            <NavLink class="nav-link" href="https://www.nuget.org/packages/Tewr.BlazorWorker.BackgroundService">
                <span class="oi oi-info" aria-hidden="true"></span><small>BackgroundService @BlazorWorkerVersion</small>
            </NavLink>
        </li>

        <li class="nav-item px-3">
            <NavLink class="nav-link" href="https://www.nuget.org/packages/Tewr.BlazorWorker.Core">
                <span class="oi oi-info" aria-hidden="true"></span><small>Core @BlazorCoreWorkerVersion</small>
            </NavLink>
        </li>
    </ul>
</div>

@code {
    private bool collapseNavMenu = true;

    private string NavMenuCssClass => collapseNavMenu ? "collapse" : null;

    private void ToggleNavMenu()
    {
        collapseNavMenu = !collapseNavMenu;
    }

    static string BlazorWorkerVersion { get; } =
    $"v{typeof(BlazorWorker.BackgroundServiceFactory.WorkerBackgroundServiceExtensions).Assembly.GetName().Version}";

    static string BlazorCoreWorkerVersion { get; } =
      $"v{typeof(BlazorWorker.WorkerCore.IWorkerMessageService).Assembly.GetName().Version}";
}
